#include <iostream>
#include <string>
using namespace std;
string opnums = "+-*%/";
enum
{
    DIVERR = 1,
    MODELERR,
    OPERR
};
class Task
{
private:
    int data1_;
    int data2_;
    char oper;
    int result_;
    int exitcode;

public:
    Task(int x, int y, char op) : data1_(x), data2_(y), oper(op), result_(0), exitcode(0) {}
    ~Task() {}
    void run()
    {
        switch (oper)
        {
        case '+':
            result_ = data1_ + data2_;
            break;
        case '-':
            result_ = data1_ - data2_;
            break;
        case '*':
            result_ = data1_ * data2_;
            break;
        case '%':
        {
            if (data2_ == 0)
            {
                exitcode = DIVERR;
            }
            else
                result_ = data1_ % data2_;
        }
        break;
        case '/':
        {
            if (data2_ == 0)
            {
                exitcode = MODELERR;
            }
            else
                result_ = data1_ / data2_;
        }
        break;
        default:
            exitcode = OPERR;
            break;
        }
    }
    string GetResult()
    {
        string r = to_string(data1_);
        r += oper;
        r += to_string(data2_);
        r += "=";
        r += to_string(result_);
        r += "[";
        r += to_string(exitcode);
        r += "]";
        return r;
    }
    string GetTask()
    {
        string r = to_string(data1_);
        r += oper;
        r += to_string(data2_);
        r += "=";
        r += "?";
        return r;
    }
};